<?php
/**
 * ============================================================================
 * Copyright (c) 2015-2018 贵州大师兄信息技术有限公司 All rights reserved.
 * siteַ: http://www.dsxcms.com
 * ============================================================================
 * @author:     David Song<songdewei@163.com>
 * @version:    v1.0.0
 * ---------------------------------------------
 * Date: 2018/8/24
 * Time: 下午5:50
 */

namespace App\Library;


use Illuminate\Contracts\Hashing\Hasher;

class PasswordHasher implements Hasher
{
    public function info($hashedValue)
    {
        // TODO: Implement info() method.
        return [];
    }

    public function make($value, array $options = [])
    {
        // TODO: Implement make() method.
        return sha1($value);
    }

    public function check($value, $hashedValue, array $options = [])
    {
        // TODO: Implement check() method.
        if(empty($hashedValue)){
            return true;
        }
        return $this->make($value) === $hashedValue;
    }

    public function needsRehash($hashedValue, array $options = [])
    {
        // TODO: Implement needsRehash() method.
        return false;
    }
}
